﻿using Abp.Application.Services;
using Abp.Application.Services.Dto;
using MyCompanyName.AbpZeroTemplate.Authorization.Users.Dto;
using MyCompanyName.AbpZeroTemplate.Prm.Admin;
using MyCompanyName.AbpZeroTemplate.Prm.Admin.Dto;
using MyCompanyName.AbpZeroTemplate.Prm.Project.Dto;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;

namespace MyCompanyName.AbpZeroTemplate.Prm.Project
{
    public interface IProjectAppService : IApplicationService
    {
        Task<List<GetProjectTeamCheckedTreeDto>> GetRoleUserTree(int projectId);
        PagedResultOutput<GetMailLogOutPut> GetMailLog([FromUri]GetMailLogInput input);


        void CreateMail([FromUri]Dictionary<string, string> dic, int c, int projectId);
        void CreateMail([FromUri]Dictionary<string, string> dic, int c, string userIds);

        /// <summary>
        /// 到期-需要标注完成的阶段进展
        /// </summary>
        void GetMailPhaseToClose();
        void GetMailDocToClose();

        List<UserListDto> GetProAppAuditUsers([FromUri]string projectno);
        /// <summary>
        /// 获取项目 分页
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        PagedResultOutput<ProjectOutPut> GetAll([FromUri] GetProjectInPut input);
        /// <summary>
        /// 获取项目成员
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<ProjectTeamOutPut> GetProjectTeam([FromUri] int projectId);
        /// <summary>
        /// 需要提交周报的项目成员以及文档连接
        /// </summary>
        /// <param name="projectId"></param>
        /// <param name="dts"></param>
        /// <returns></returns>
        List<ProjectWeekTeam> GetWeekProjectTeam(int projectId,DateTime preMondy);
        List<ProjectWeekTeam> GetWeekProjectTeam();
        /// <summary>
        /// 获取项目最新进度
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        Task<GetProgressOutPut> GetLastProgressOutPut([FromUri]int projectId);
        /// <summary>
        /// 获取所有项目进度
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<GetProgressOutPut> GetProgressAll([FromUri]int projectId);
        /// <summary>
        /// 获取项目评论
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<GetTeamCommentOutPut> GetTeamComment([FromUri]int projectId);
        /// <summary>
        /// 创建项目
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task CreateProject(CreateProjectInPut input);
        /// <summary>
        /// 删除项目成员
        /// </summary>
        /// <param name="projectRoleId"></param>
        /// <param name="projectId"></param>
        /// <returns></returns>
        Task RemoveProjectTeam([FromUri]int projectRoleId, int projectId);

        /// <summary>
        /// 离开项目组
        /// </summary>
        /// <param name="projectRoleId"></param>
        /// <param name="projectId"></param>
        /// <returns></returns>
        Task LeaveProjectTeam(int projectRoleId, int projectId);
        /// <summary>
        /// 编辑项目
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task EditProject(EditProjectInPut input);
        /// <summary>
        /// 编辑项目成本
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task EditCost(EditCostInput input);
        /// <summary>
        /// 根据ID获取项目
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ProjectOutPut> Get(int id);
        string GetProNo(int id);

        void GetMailTask();
        void GetMailRecord([FromUri]int recordId);
        /// <summary>
        /// 删除项目进度
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task DelProgress([FromUri]int id);
        /// <summary>
        /// 创建项目进度
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task CreateProjectProgress(CreateProjectProgressInput input);
        /// <summary>
        /// 设置项目进展备注
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task SetProjectTaskNote(CreateProjectTaskNoteInput input);
        /// <summary>
        /// 设置项目成员
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task SetProjectTeam(CreateProjectTeamInPut input);

        /// <summary>
        /// 重置询盘的九洲编号
        /// </summary>
        /// <returns></returns>
        void ResetQuriyNo();
        /// <summary>
        /// 更新项目评论
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task UpdateTeamComment(List<EditTeamCommentInPut> input);
        /// <summary>
        /// 获取项目操作日志
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<GetOperationLogOutPut> GetOperationLog([FromUri]GetOperationLogInPut input);
        /// <summary>
        /// 获取项目进展 (上面有重复方法)
        /// </summary>
        /// <returns></returns>
        List<GetProjectProgressOutPut> GetProjectProgress();
        List<GetProjectProgressOutPut> GetFollowerProjects([FromUri] GetProjectInPut input);

        /// <summary>
        /// 历年询盘和项目的个数
        /// </summary>
        /// <param name="customer"></param>
        /// <returns></returns>
        List<dynamic> GetHistoryProInquiry([FromUri] string customer);
        /// <summary>
        /// 根据产品ID获取项目
        /// </summary>
        /// <param name="productId"></param>
        /// <returns></returns>
        List<ProjectOutPut> GetByProductId([FromUri]int productId);
        Task<List<GetProjectTeamCheckedTreeDto>> GetProjectTeamTree([FromUri]int projectId, int taskId);
        /// <summary>
        /// 根据项目ID获取项目阶段
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>

        List<GetPhaseInfoTreeOutPut> GetProjectPhase([FromUri]int projectId);
        int GetProjectPhaseCount([FromUri]int projectId);
        /// <summary>
        /// 历年阶段数据
        /// </summary>
        /// <returns></returns>
        dynamic GetHistoryProjectPhase();
        int GetProjectPhaseFinishedCount([FromUri]int projectId);
        /// <summary>
        /// 编辑或创建项目阶段
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task SetProjectPhase(List<EditProjectPhaseInPut> input);

        List<dynamic> GetProjectPhaseReport([FromUri]int productId = 0);


        Task<List<dynamic>> GetProjectDocumentReport([FromUri]int productId = 0);

        /// <summary>
        /// 获取项目阶段CheckBox树
        /// </summary>
        /// <param name="projectId"></param>
        /// <returns></returns>
        List<GetProjectPhaseCheckTree> GetProjectPhaseCheckTree([FromUri]int projectId = 0);
        Task UnFollowerProject([FromUri]int id);
        Task FollowerProject([FromUri]int id);
    }
}
